<?php
if(basename($_SERVER['SCRIPT_NAME']) != "barangbukti.php") {
	header("Location:../../barangbukti.php");
	die();
}
?>
<div class="da-panel">
<?php 					
	$q = mysql_query("SELECT * FROM t_bb_detail a inner join t_bb b on a.kd_bb=b.kd_bb where a.kd_bb='$_GET[detail]'");
		while($dt = mysql_fetch_array($q)) {
			$register	= $dt['kd_reg_bb'];
			$perkara	= $dt['kd_perkara'];
			$tgl		= $dt['tanggal'];
			$jenis		= $dt['kd_jenis'];
			$nama		= $dt['keterangan'];
			$jumlah		= $dt['jumlah'];
			$satuan		= $dt['satuan'];
			$kddetail	= $dt['kd_detail'];
			$kd_bb		= $dt['kd_bb'];
		}
?>
<div class="da-panel-content da-form-container">
<form id="da-dialog-add-val" class="da-form" method="post" action="modul/barangbukti/barangbukti.proses.php">
	<div id="da-validate-error" class="da-message error" style="display:none;"></div>
	<table class="da-table da-detail-view no-border">
		<tbody>
		<tr>
			<th>Nomor Register</th>
			<td>
				<input type="text" placeholder="Nomor Register Barang Bukti" name="kd_reg_bb" value="<?php echo $register;?>">
				<!-- 164 / RB.2 / Ep.2 / 02 / 2010 -->
			</td>
		</tr>
		<tr>
			<th>Perkara</th>
			<td>
				<select class="select2 span6" name="kd_perkara">
				<?php
					$q = mysql_query("SELECT kd_perkara FROM t_perkara");
					while($dt = mysql_fetch_array($q)) {
						$status = ($perkara == $dt['kd_perkara']) ? 'selected':'';					
				?>
					<option value="<?php  echo $dt['kd_perkara'] ?>" <?php echo $status;?> ><?php echo $dt['kd_perkara'] ?></option>
				<?php } ?>
				</select>
			</td>
		</tr>
		<tr>
			<th>Tanggal</th>
			<td>
				<input type="text" id="da-tgl-bb" class="da-tgl-bb" name="tanggal" value="<?php echo konversi_tanggal('d-m-Y',$tgl) ?>"/>
			</td>
		</tr>
		<tr>
			<th>Jenis Barang Bukti</th>
			<td>
				<select name="jenis">
				<option value="0">-- Pilih --</option>				
				<?php 
					$q_jenis = mysql_query("SELECT * FROM t_bb_jenis");
					while($dt_jenis = mysql_fetch_array($q_jenis)) {
						$status = ($jenis == $dt_jenis['kd_jenis']) ? 'selected':'';										
				?>
					<option value="<?php echo $dt_jenis['kd_jenis'] ?>" <?php echo $status;?> ><?php echo $dt_jenis['nm_jenis'] ?></option>
				<?php } ?>
				</select>
			</td>
		</tr>
		<tr>
			<th>Nama Barang Bukti</th>
			<td>
				<input type="text" id="da-nama-bb" name="bb" value="<?php echo $nama;?>"/>
			</td>
		</tr>		
		<tr>
			<th>Jumlah</th>
			<td>
				<input type="text" id="da-jumlah-bb" name="jumlah" value="<?php echo $jumlah;?>"/>
			</td>
		</tr>		
		<tr>
			<th>Satuan</th>
			<td>
				<input type="text" id="da-satuan-bb" name="satuan" value="<?php echo $satuan;?>"/>
			</td>
		</tr>		
		
		</tbody>
	</table>

	<div class="btn-row">
		<a href="barangbukti.php" class="btn"><i class="icol-cross"></i> Batal</a>
		<button class="btn"><i class="icol-disk"></i> Simpan</button>
		<input type="hidden" name="barangbukti" value="ubah" />
		<input type="hidden" name="kddetail" value="<?php echo $kddetail;?>" />
		<input type="hidden" name="kd_bb" value="<?php echo $kd_bb;?>" />		
	</div>
</form>
</div>

</div>
